{% extends 'base.html' %}

{% load i18n %}
{% load l10n %}
{% load staticfiles %}

{% block title %}{% trans "Validations submited" %} - Wapyce{% endblock %}
{% block content %}
<div class="row">
  <div class="col-md-10 col-md-offset-1">
    <h2>{% trans "Validation submited" %}</h2>
    <div class="container-fluid">
      <div class="row">
        <div class="col-xs-4"><strong>{% trans "UUID" %}</strong></div>
        <div class="col-xs-8">{{ object.uuid }}</div>
      </div>
      <div class="row">
        <div class="col-xs-4"><strong>{% trans "Base URL" %}</strong></div>
        <div class="col-xs-8"><a href="{{ object.site.base_url }}" target="_blank">{{ object.site.base_url }}</a></div>
      </div>
      <div class="row">
        <div class="col-xs-4"><strong>{% trans "Github repository" %}</strong></div>
        <div class="col-xs-8"><a href="{{ object.site.github_url }}" target="_blank">{{ object.site.github_url }}</a></div>
      </div>
      <div class="row">
        <div class="col-xs-4"><strong>{% trans "User" %}</strong></div>
        <div class="col-xs-8"><a href="https://github.com/{{ object.user }}" target="_blank">{{ object.user }}</a></div>
      </div>
      <div class="row">
        <div class="col-xs-4"><strong>{% trans "Start date" %}</strong></div>
        <div class="col-xs-8">{{ object.start_date|localize }}</div>
      </div>
      <div class="row">
        <div class="col-xs-4"><strong>{% trans "End date" %}</strong></div>
        <div class="col-xs-8">{{ object.end_date|localize }}</div>
      </div>
      <div class="row">
        <div class="col-xs-4"><strong>{% trans "Validation status" %}</strong></div>
        <div class="col-xs-8">{{ object.get_status_display }}</div>
      </div>
      <div class="row">
        <div class="col-xs-12">
          <h3>{% trans "Validated pages" %}</h3>
        </div>
      </div>
      {% for page in object.page_set.all %}
      <div class="row">
        <div class="col-xs-12">
          <h4>
            {% blocktrans with page_url=page.page_url %}
              Page <small><a href="{{ page_url }}" target="_blank">{{ page_url }}</a></small>
            {% endblocktrans %}
          </h4>
          {% for issue in page.issuepage_set.all %}
          <div class="container-fluid">
            <div class="row">
              <div class="col-xs-12">
                <h5>
                  {% blocktrans with uuid=issue.uuid %}
                    Issue <small>{{ uuid }}</small>
                  {% endblocktrans %}
                </h5>
              </div>
            </div>
            <div class="row">
              <div class="col-xs-4"><strong>{% trans "Type" %}</strong></div>
              <div class="col-xs-8">{{ issue.get_issue_type_display }}</div>
            </div>
            <div class="row">
              <div class="col-xs-4"><strong>{% trans "Issue code" %}</strong></div>
              <div class="col-xs-8">{{ issue.code }}</div>
            </div>
            <div class="row">
              <div class="col-xs-4"><strong>{% trans "Message" %}</strong></div>
              <div class="col-xs-8">{{ issue.message }}</div>
            </div>
            <div class="row">
              <div class="col-xs-4"><strong>{% trans "Selector" %}</strong></div>
              <div class="col-xs-8">{{ issue.selector }}</div>
            </div>
            <div class="row">
              <div class="col-xs-4"><strong>{% trans "Context" %}</strong></div>
              <div class="col-xs-8">{{ issue.context }}</div>
            </div>
          </div>
          <hr />
          {% endfor %}
        </div>
      </div>
      {% endfor %}
    </div>
  </div>
</div>
{% endblock %}
